package com.jzoom.zoom.admin.controllers;

import com.jzoom.zoom.admin.models.ComponentsService;
import com.jzoom.zoom.common.annotations.Inject;
import com.jzoom.zoom.web.annotations.Controller;
import com.jzoom.zoom.web.annotations.Mapping;
import com.jzoom.zoom.web.annotations.Param;
import com.jzoom.zoom.web.view.impl.StringView;

@Controller(key="components")
public class ComponentsController implements AdminController {
	
	@Inject
	private ComponentsService componentsService;
	
	/**
	 * 返回的是一个js
	 * @return
	 */
	@Mapping(value="js/{version}",method={Mapping.GET})
	public StringView js(
			@Param(pathVariable=true) String version
			) {
		
		return componentsService.getComponents();
	}
	
}
